package org.summerframework.component.security.oauth.alipay;

import org.summerframework.component.security.oauth.Info;

import java.util.Date;

/**
 * QQUserInfo
 *
 * @author 石超
 * @date 2016/3/29
 */
public class AlipayUserInfo extends Info {
    private static final long serialVersionUID = 1145475424767987065L;
    private String authToken;//通过该令牌来帮助商户/个人发起请求，完成业务
    private String refreshToken; //刷新令牌后，我们会保证老的auth_token从刷新开始10分钟内可继续使用，请及时替换为最新token
    private String appId;//授权商户的AppId（如果有服务窗，则为服务窗的AppId）
    private String expiresIn;//交换令牌的有效期，单位秒，换算成天的话为365天
    private String reExpiresIn;//刷新令牌有效期，单位秒，换算成天的话为372天
    private String userId; //授权者的PID
    private Integer sex; // 1:男 2:女
    private String avatar; //头像
    private String province; //省
    private String city; //市
    private String nickname; //昵称  可能为空
    private Integer isStudentCertified;//是否是学生  0:非 1:是
    /**
     * 用户类型（1/2）
     * 1代表公司账户2代表个人账户
     */
    private Integer userType;
    /**
     * 用户状态（Q/T/B/W）。
     * Q代表快速注册用户
     * T代表已认证用户
     * B代表被冻结账户
     * W代表已注册，未激活的账户
     */
    private String userStatus;
    private Integer isCertified;//是否是认证用户  0:非 1:是
    private Date requestDate = new Date();

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAuthToken() {
        return authToken;
    }

    public void setAuthToken(String authToken) {
        this.authToken = authToken;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public String getExpiresIn() {
        return expiresIn;
    }

    public Date getExpiresInToDate() {
        return new Date(requestDate.getTime() + Long.valueOf(expiresIn) * 1000);
    }

    public void setExpiresIn(String expiresIn) {
        this.expiresIn = expiresIn;
    }

    public String getReExpiresIn() {
        return reExpiresIn;
    }

    public Date getReExpiresInToDate() {
        return new Date(requestDate.getTime() + Long.valueOf(reExpiresIn) * 1000);
    }

    public void setReExpiresIn(String reExpiresIn) {
        this.reExpiresIn = reExpiresIn;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getIsStudentCertified() {
        return isStudentCertified;
    }

    public void setIsStudentCertified(Integer studentCertified) {
        isStudentCertified = studentCertified;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(String userStatus) {
        this.userStatus = userStatus;
    }

    public Integer getIsCertified() {
        return isCertified;
    }

    public void setIsCertified(Integer certified) {
        isCertified = certified;
    }
}
